<template>
  学生姓名：{{ studentName }}<br>
  Vue成绩：{{ grode.Vue }}<br>
  jQuery成绩：{{ grode.jQuery }}<br>
  <button @click="updateLocation">调用父组件方法</button>
</template>

<script>
import { reactive, toRefs } from '@vue/reactivity'
import { inject } from '@vue/runtime-core'
export default {
    setup () {
        const state = reactive({
            count: 0
        })
        const studentName = inject('studentName', 'The Universe')
        const grode = inject('grode')
        const updateLocation = inject("updateLocation")
        return {
            ...toRefs(state),
            studentName,
            grode,
            updateLocation
        }
    }

    
}
</script>

<style>

</style>